package com.jack.leetcode.每日一题;

/*** 
 * @author zhangjie
 * @date 2020/4/1 21:31
 */
public class 有效括号的嵌套深度 {

    public static void main(String[] args) {
        int[] a = maxDepthAfterSplit("()()(())");
        for(int i = 0;i<a.length;i++){
            System.out.println(a[i]);
        }
    }

    public static int[] maxDepthAfterSplit(String seq) {
        int[] result = new int[seq.length()];
        int d = 0;
        for(char c:seq.toCharArray()){
            result[d++] = c == '(' ? d&1 : (d + 1)&1;
        }
        return result;
    }
}
